#include <standard/resourcemanager.h>
#include <standard/geometrymath.h>
#include <standard/notification.h>
#include <standard/texturebuffer.h>

#include "terrain/terrainobject.h"
#include "terrain/terrainblock.h"

#include "scene/sceneobjectnavigationmap.h"

#include "navigationhelperobject.h"

/////////////////////////////////////////////////////////////////////////////////////////////////
CNavigateionHelperObject::CNavigateionHelperObject(){
	m_nGameObjectType = 4;
}
CNavigateionHelperObject::~CNavigateionHelperObject(){

}
void CNavigateionHelperObject::Init( CSceneObjectNavigationMap* pSceneObjectNavigationMap ){
	m_pSceneObjectNavigationMap = pSceneObjectNavigationMap;

	m_rRenderItem = NEW CRenderItem(m_vWorldM);
	m_rRenderItem->m_eRenderType = 0;
	m_rRenderItem->m_bDepthWrite = False;
	m_rRenderItem->m_bDepthTest = False;
	m_rRenderItem->m_bCastShadow = False;
	m_rRenderItem->m_bReceiveShadow = False;
	m_rRenderItem->m_bFogEnable = False;
	m_rRenderItem->m_bLightEnable = False;
	m_rRenderItem->m_bLineMode = False;
	m_rRenderItem->m_eBlending = NoBlending;
	m_rRenderItem->SetPrimitiveType( EPT_TRIANGLE_LIST );
	//CTexture* _pTexture = RESOURCE_GETTEXTURE("UV_Grid_Sm1.jpg");
	//m_rRenderItem->CreateNormalDiffuseBatchData(_pTexture, m_rTerrainHelperGeometry->GetRenderBuffer(), m_rTerrainHelperGeometry->GetIndexBuffer());
	//m_rTerrainHelperGeometry->InitGeometry( m_rRenderItem.GetEntityData() );

	m_rRenderItem->CreateNormalDiffuseBatchData( pSceneObjectNavigationMap->m_rNavicationMapTextureBuffer.GetEntityData(), pSceneObjectNavigationMap->m_rVertexBuffer.GetEntityData(), pSceneObjectNavigationMap->m_rIndexBuffer.GetEntityData() );
	//m_rRenderItem->CreateNormalDiffuseBatchData( _pTexture, pSceneObjectNavigationMap->m_rVertexBuffer.GetEntityData(), pSceneObjectNavigationMap->m_rIndexBuffer.GetEntityData() );
}
void CNavigateionHelperObject::UpdateGeometry(){

}
int32 CNavigateionHelperObject::GetRenderElementHandles(CRenderElement** vRenderElementHandle, int32 nMaxCount){
	vRenderElementHandle[0] = m_rRenderItem->m_pRenderElement.GetEntityData();
	return 1;
}

